<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<title>DiR-前端演示文件</title>
	<!-- <link href="misc/css/base.css" rel="stylesheet" type="text/css" media="all" /> -->
	<!-- <link href="misc/css/style.css" rel="stylesheet" type="text/css" media="all" /> -->
	<script src="misc/js/jquery-1.9.1.js" type="text/javascript"></script>
	<script src="misc/js/package.js" type="text/javascript"></script>
</head>
<body>
<h2>新闻列表</h2>
<div class="newList"></div>
<h2>图片列表</h2>
<div class="picList"></div>
<a target="_blank" href="../admin/">登录后台</a>
</body>
<script type="text/javascript">
$(document).ready(function(){
	Dir.ajax('php/new.php',{},function(res){
		if( res.status ){
			var str = '<ul>';
			var data = res.data;
			for(var i = 0; i < data.length; i++){
				str += '<li><a target="_blank" href="newShow.html?id='+data[i].id+'">'+data[i].title+'</a>　<span>'+data[i].time+'</span></li>';
			}
			str += '</ul>';
			$('.newList').html(str);
		}
	});
	Dir.ajax('php/pic.php',{},function(res){
		var str = '<ul>';
		var data = res.data;
		for(var i = 0; i < data.length; i++){
			str += '<li><img src="../admin/'+data[i].path+'" alt="" /></li>';
		}
		str += '</ul>';
		$('.picList').html(str);
	});
});
</script>
</html>